﻿Class NavigationRenderer
    Inherits ToolStripProfessionalRenderer

    Sub New()
        RoundedEdges = False
    End Sub

    Protected Overrides Sub OnRenderToolStripBackground(ByVal e As System.Windows.Forms.ToolStripRenderEventArgs)
    End Sub

    Protected Overrides Sub OnRenderToolStripBorder(ByVal e As System.Windows.Forms.ToolStripRenderEventArgs)
    End Sub

    Protected Overrides Sub OnRenderButtonBackground(ByVal e As System.Windows.Forms.ToolStripItemRenderEventArgs)
    End Sub

    Protected Overrides Sub OnRenderSeparator(ByVal e As System.Windows.Forms.ToolStripSeparatorRenderEventArgs)
        Dim R As Rectangle = e.Item.Bounds
        e.Graphics.DrawLine(Pens.Black.A(0.5), R.Left + R.Width \ 2, R.Top, R.Left + R.Width \ 2, R.Bottom)
    End Sub

    Protected Overrides Sub OnRenderItemImage(ByVal e As System.Windows.Forms.ToolStripItemImageRenderEventArgs)
        If Not e.Item.Enabled Then
            e.Graphics.DrawImage(e.Image.Disabled, e.ImageRectangle)
        ElseIf e.Item.Pressed Then
            e.Graphics.DrawImage(e.Image.Pressed, e.ImageRectangle)
        ElseIf e.Item.Selected Then
            e.Graphics.DrawImage(e.Image.Selected, e.ImageRectangle)
        Else
            'DrawImageWithOpacity(e.Graphics, e.Image, e.ImageRectangle, 0.25)
            MyBase.OnRenderItemImage(e)
        End If
    End Sub

End Class
